package com.abc;

import java.io.File;
import java.io.FileInputStream;
public class Words{ 
	
	
	public static void main(String args[]) throws 
		Exception{
		int count =0;
		File file = new File("D:\\Temp\\word.txt");
		FileInputStream fil = new FileInputStream(file);
		byte[] bytesArray = new byte[(int)file.length()];
		fil.read(bytesArray);
		String s = new String(bytesArray);
		String [] data = s.split(" ");
		for (int i=0; i<data.length; i++) {	
			count++;}
        System.out.println("共有单词个数为：" +count);}
}



